package Library;

public class BookList {
    private Book[] books = new Book[1024];
    //最大容量1024
    private int size = 0;
    //实际放了多少
    public BookList(){
        books[0] = new Book("红楼梦","曹雪芹",100,"古典小说");
        books[1] = new Book("西游记","吴承恩",90,"古典小说");
        books[2] = new Book("高等数学","高斯",66,"数学");
        books[3] = new Book("java入门到精通","詹姆斯.高斯林",50,"java");

        size = 4;  //实际放了4本书
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public Book getBook(int index) {
        return books[index];
    }

    public void setBook(int index ,Book book) {
        books[index] = book;
    }
}
